<?php
/**
 * SocialEngine
 *
 * @category   Application_Extensions
 * @package    Sitepage
 * @copyright  Copyright 2010-2011 BigStep Technologies Pvt. Ltd.
 * @license    http://www.socialengineaddons.com/license/
 * @version    $Id: partialPhotoWidget.tpl 2011-05-05 9:40:21Z SocialEngineAddOns $
 * @author     SocialEngineAddOns
 */
?>
<?php 
	$this->headScript()
	->appendFile($this->seaddonsBaseUrl() . '/application/modules/Sitepage/externals/scripts/core.js');
		$this->headLink()
	  ->appendStylesheet($this->seaddonsBaseUrl()
	    . '/application/modules/Sitepagealbum/externals/styles/style_sitepagealbum.css');
	    
	    
?>

<script type="text/javascript">
  var submit_topageprofile = true;
  function ShowPhotoPage(pageurl) {
    if (submit_topageprofile) {
      window.location = pageurl;
    }
    else {
      submit_topageprofile = true;
    }
  }

</script>
	
	<?php if($this->showLightBox): ?>
		<?php include_once APPLICATION_PATH . '/application/modules/Sitepagealbum/views/scripts/_lightboxImage.tpl'; ?>
	<?php endif;?>


<div class="sitepagealbum_sidebar">
	<?php if ((count($this->paginator) > 0)): ?>
	  <ul class="sitepagealbum_sidebar_thumbs">
	    <?php foreach ($this->paginator as $sitepagephoto):  ?>	   
	      <li class="mbot5"> 
	        <?php if (!$this->showLightBox): ?>
	          <a href="javascript:void(0)" onclick='ShowPhotoPage("<?php echo $sitepagephoto->getHref() ?>")' title="<?php echo $sitepagephoto->title; ?>"  class="thumbs_photo">		
	            <span style="background-image: url(<?php echo $sitepagephoto->getPhotoUrl('thumb.normal'); ?>);"></span>
	          </a>
	        <?php else: ?> 
	           <a href="<?php echo $sitepagephoto->getHref() ?>" onclick='openLightBox("<?php echo $sitepagephoto->getPhotoUrl() ?>","<?php echo Engine_Api::_()->sitepage()->getHreflink($sitepagephoto) ?>");return false;' title="<?php echo $sitepagephoto->title; ?>" class="thumbs_photo">
	            <span style="background-image: url(<?php echo $sitepagephoto->getPhotoUrl('thumb.normal'); ?>);"></span>
	          </a>
	        <?php endif; ?> 
	        <?php if($this->show_detail == 1):?>
	        	<?php if($this->show_info == 'comment') :?>
			        <div class='sitepagealbum_thumbs_details center'>	
		            <?php echo $this->translate(array('%s comment', '%s comments', $sitepagephoto->comment_count), $this->locale()->toNumber($sitepagephoto->comment_count)) ?>          
		          </div>
	          <?php else:?>
		          <div class='sitepagealbum_thumbs_details center'>	
		            <?php echo $this->translate(array('%s like', '%s likes', $sitepagephoto->like_count), $this->locale()->toNumber($sitepagephoto->like_count)) ?>          
		          </div>
	          <?php endif;?>
          <?php endif;?>
	     </li>
	    <?php endforeach; ?>
	  </ul>	
	<?php endif; ?>  
</div>
